package com.google.code.test.stock;

import org.springframework.stereotype.Component;

import com.google.code.Create;

@Component
public class BeanFactory {

    @Create("a customer who bought a black jumper")
    public Customer customerWithOneBlackJumper() {

        Customer customer = new Customer();
        customer.getProducts().add(blackJumper());

        return customer;
    }

    @Create("three black jumpers in stock")
    public Stock stockWithThreeBlackJumpers() {

        Stock stock = new Stock();
        stock.getProducts().add(blackJumper());
        stock.getProducts().add(blackJumper());
        stock.getProducts().add(blackJumper());

        return stock;
    }

    private Product blackJumper() {

        Product product = new Product();
        product.setName("black jumper");

        return product;
    }
}
